/**
 * @author zhaotaisong
 */
public class Problem {
    private int x;
    private int y;
    private int symbol;
    private int result;
    private int studentResult;
    private String expression;

    public Problem() {
    }
    public Problem(int x, int y, int symbol) {
        this.x = x;
        this.y = y;
        this.symbol = symbol;
    }

    public int getX() {
        return x;
    }
    public void setX(int x) {
        this.x = x;
    }
    public int getY() {
        return y;
    }
    public void setY(int y) {
        this.y = y;
    }
    public int getSymbol() {
        return symbol;
    }
    public void setSymbol(int symbol) {
        this.symbol = symbol;
    }
    public int getResult() {
            return result;
    }
    public void setResult(int result) {
        this.result = result;
    }
    public int getStudentResult() {
        return studentResult;
    }
    public void setStudentResult(int studentResult) {
        this.studentResult = studentResult;
    }
    public String getExpression() {
        return expression;
    }
    public void setExpression(String expression) {
        this.expression = expression;
    }
    public void matchSymbol(){
        switch (symbol){
                case 0:
                    result = x+y;
                    expression = x+"+"+y+"=";
                    break;
                case 1:
                    result = x-y;
                    expression = x+"-"+y+"=";
                    break;
                    case 2:
                    result = x*y;
                    expression = x+"*"+y+"=";
                    break;
                case 3:
                    result = x/y;
                    expression = x+"/"+y+"=";
                    break;
                default:
                    break;
            }
        }
        @Override
        public String toString() {
            return expression+"|"+result+"|"+studentResult;
        }
}